package design.simdi.code.final_paper.site.panels.sesiuni;

import org.apache.wicket.model.LoadableDetachableModel;

import design.simdi.code.final_paper.core.daos.SesiuneDao;
import design.simdi.code.final_paper.core.entities.Sesiune;

/**
 * 
 * @author Marius Dumitriu - (Jun 24, 2010 - 12:31:26 AM)
 * 
 */
public class DetachableSesiuneModel extends LoadableDetachableModel<Sesiune> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final long id;
	private final SesiuneDao sesiuneDao;

	public DetachableSesiuneModel(Sesiune object, SesiuneDao sesiuneDao) {
		super(object);
		this.id = object.getId();
		this.sesiuneDao = sesiuneDao;
	}

	@Override
	protected Sesiune load() {
		return sesiuneDao.get(id);
	}

}
